package ncme.auto.framework.core.aspects;

import ncme.auto.framework.core.annotation.Remind;
import ncme.auto.framework.core.annotation.aspect.AutoNoEntityProcess;
import ncme.auto.framework.core.aspects.base.BaseAutoAspect;
import ncme.auto.framework.core.entities.ResMsg;
import ncme.auto.framework.core.entities.aspect.AspectInfo;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Remind("用于有参数的但没有paramEntity的controller" +
        "通过requestMapping 的内容反射到对应service的函数，要求路径智能有一级" +
        "serviceImpl对应参数为Map，HttpServletRequest")
@Aspect
@Component
public class AutoNoEntityAspect extends BaseAutoAspect<AutoNoEntityProcess> {

    @Pointcut("@annotation(com.hby.common.annotation.aspect.AutoNoEntityProcess)")
    public void aspectCut() {
    }

    @Override
    protected void parameterVerify(AspectInfo aspectInfo) {
        //对第一个参数（需为Map）进行参数验证
        verifyParamsExist(aspectInfo.getParameter1(), aspectInfo.getAnnotationInfo().getAutoNoEntityProcess().REQUIRED_PARAMS());
    }

    @Override
    protected void parameterPreHandler(AspectInfo aspectInfo) {

    }

    @Override
    protected ResMsg autoProcess(AspectInfo aspectInfo) {
        return null;
    }


}
